package com.qf.java2201.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @date 2022/4/22
 * @desc
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class R<T> {

    private Integer code;  // 响应的状态码

    private String msg;  // 响应的 提示信息

    private T data;   // 响应的数据


    public R(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public static R ok(){
        return new R(200, "ok");
    }

    public static R error(){
        return new R(500, "error");
    }
}

